﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SharpErp.Common.Util
{
    public class NumberUtil
    {
        public static double parseDefault(string str, double value = 0)
        {
            if (string.IsNullOrEmpty(str)) return value;
            double.TryParse(str, out value);
            return value;
        }

        public static int parseIntDefault(string str, int value= 0)
        {
            if (string.IsNullOrEmpty(str)) return value;
            int.TryParse(str, out value);
            return value;
        }
    }
}
